package com.gitee.wsl.collections.delegate

import com.gitee.wsl.collections.queue.Queue


/**
 * Queue type that delegates to another implementation.
 *
 * @param <T>
 * Queue item type.
 *
 * @author Matt Coley
</T> */
open class DelegatingQueue<T>(protected open val delegate: Queue<T>) :  Queue<T> by delegate {
    override fun add(element: T): Boolean = delegate.add(element)

    override fun offer(e: T): Boolean  = delegate.offer(e)

    override fun remove(): T? = delegate.remove()

    override fun pollOrNull(): T? = delegate.pollOrNull()

    override fun element(): T = delegate.element()

    override fun peekOrNull(): T? = delegate.peekOrNull()

    override fun clear() = delegate.clear()

    override fun remove(element: T): Boolean = delegate.remove(element)

    override fun addAll(elements: Collection<T>): Boolean = delegate.addAll(elements)

    override fun removeAll(elements: Collection<T>): Boolean = delegate.removeAll(elements)

    override fun retainAll(elements: Collection<T>): Boolean = delegate.retainAll(elements)

    override fun containsAll(elements: Collection<T>): Boolean = delegate.containsAll(elements)

}
